Field
The present invention relates to a method and system for culling hidden tessellated primitives in a tile based computer graphics rendering system.
Related Art
Tile based rendering is a known technique for rendering 2D or 3D computer graphics images. A rendering space is sub-divided into a plurality of regions called tiles or blocks, which are typically rectangular, and each comprises a plurality of pixels. The rendering space may correspond to an image for display on a screen, but other render targets, such as texture data in memory, are also possible. Tiles can be various sizes, but a typical size is for example 16×16 pixels. An image of 1280×1024 pixels may be sub-divided into 5120 tiles (each comprising 16×16 pixels), for example.
In tile based computer graphics systems primitive data is typically read from memory and transformed into screen space. Primitives are often polygons, for example triangles, but may be lines or points. A display list is then generated, for each tile, indicating the primitives, if any, which are located either wholly or partially within the tile. The indication often comprises an identifier or index for each primitive, which references or provides a pointer to geometrical data associated with the primitive stored in a parameter memory. The display lists are stored in memory.
Each tile is then rendered independently using its display list.
For each tile, the primitives identified in the respective display list are processed and hidden surface removal may be performed. The resultant pixel data for visible fragments is then passed to a shading unit which applies textures and shading to each visible pixel within an object. After final pixel values have been determined for each pixel in the tile, the pixel data for the tile is written to memory for display on an output device.
Hidden surface removal typically uses a technique known as “z buffering”. In this technique, depth values are calculated for each primitive at every pixel in the tile covered by the primitive. Then, processing each primitive in turn, the depth values of each primitive are compared to the depth values for the respective pixels stored in a “z buffer”. If the depth value of a new primitive is closer to the eye or viewpoint than the presently stored depth value (for the surface of the previously processed primitives which is presently visible at that pixel), then the depth value for that pixel, and the other values for that pixel, are replaced with the values of the new primitive at the respective pixel. If the depth value of a new primitive is further from the eye or viewpoint than the presently stored depth value, the values, including the depth value, of that pixel remain unchanged.
Tessellation is a known technique for adding texture to a low detail model, generally referred to in the computer graphics industry as a patch of surface data. A patch of surface data is split into a plurality of primitives which are then optionally displaced from the surface of the patch to derive a plurality of tessellated primitives. The primitives may be displaced by application of a user programmable function and/or in dependence on a displacement height map. The tessellated primitives may then be tiled and rendered as described above. Tessellation is a useful tool which is being used more and more widely in the computer graphics industry. However, it will be appreciated that tessellating a patch of surface data can substantially increase the amount of computation which is required to render an image. Each tessellated patch of surface data may comprise thousands of tessellated primitives, which need to be processed and which may also need to be stored in memory.
The applicant has appreciated that it would be desirable to decrease the amount of data transfer, data storage, and processing required to render a tile and, in particular, a tile comprising tessellated primitives.